package com.sy.nio.c1;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/**
 * @Author yumax
 * @Date 2024 01 04 10 13
 **/
public class Client {

    public static void main(String[] args) throws IOException {
        final SocketChannel channel = SocketChannel.open();
        channel.connect(new InetSocketAddress("localhost", 8989));
        channel.write(Charset.defaultCharset().encode("01234567890123456789\n"));
        System.in.read();
    }
}
